def calculate_series_sum(a, n):
    total_sum = 0
    current_term = 0
    for i in range(1, n + 1):
        current_term = current_term * 10 + a
        total_sum += current_term
    return total_sum

a = int(input())
n = int(input())

result = calculate_series_sum(a, n)
print(result)